using System;
namespace Senparc.Weixin.QY.Entities
{
	public static class Extensions
	{
		public static RequestMessageText ConvertToRequestMessageText(this IRequestMessageEventBase requestMessageEvent)
		{
			RequestMessageText requestMessageText = new RequestMessageText
			{
				FromUserName = requestMessageEvent.FromUserName,
				ToUserName = requestMessageEvent.ToUserName,
				CreateTime = requestMessageEvent.CreateTime,
				MsgId = requestMessageEvent.MsgId
			};
			if (requestMessageEvent is IRequestMessageEventKey)
			{
				requestMessageText.Content = (requestMessageEvent as IRequestMessageEventKey).EventKey;
			}
			else
			{
				requestMessageText.Content = "";
			}
			return requestMessageText;
		}
	}
}
